package com.hk.service.impl;

import org.springframework.stereotype.Service;

import com.hk.commons.LongId;
import com.hk.commons.entity.Department;
import com.hk.dao.base.impl.BaseServiceImpl;
import com.hk.service.sys.IDepartment;


@Service
public class DepartmentImpl extends BaseServiceImpl<Department> implements IDepartment {

	@Override
	public Department findById(Long id) {
		return getById(id);
	}

	@Override
	public Long add(Department model) {
		
		
		Long id = LongId.get();
		model.setId(id);
		
		model.setCreatedts( System.currentTimeMillis());
		super.save(model);
		
		return id;
	}

	@Override
	public Department delete(Long id) {
		System.out.println("id in Department delete(Long id) =" + id );
		Department model=new Department();
		model.setId(id);
		super.delete(model);
		return model;
	}


}
